<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>传统DOM</title>
  </head>
  <body>
    <div id="jsDOM"></div>
    <div id="jqDOM"></div>
  </body>
  <script src="../../lib/jquery.js"></script>
  <script>
    const str = "<h1>hello ty-2208</h1>";
    // js原生DOM操作
    const jsDOM = document.getElementById("jsDOM");
    // jsDOM.innerHTML = str
    // jsDOM.innerText = str
    jsDOM.textContent = str;

    // jQueryDOM操作
    const $jqDOM = $("#jqDOM");
    console.log($jqDOM[0] === document.getElementById("jqDOM")); // true
    // $jqDOM.html(str)
    $jqDOM.text(str);
  </script>
</html>
